
var IMAGINARIUM = {};

(function() {
  var initBatch = [];
  
  IMAGINARIUM.initBatch = {
    add: function(fn, scope) {
      if (typeof scope === "object") {
        initBatch.add({
          fn: fn,
          scope: scope
        });
      } else {
        initBatch.add(fn);
      }
    },
    
    run: function() {
      for (var a = 0; a < initBatch.length; a++) {
        if (typeof initBatch[a] === "function") {
          initBatch[a].call(this);
        } else if (typeof initBatch[a] === "object" 
                  && typeof initBatch[a].fn === "function") {
          initBatch[a].fn.call(initBatch[a].scope || this);
        }
      }      
    }
  };
})();

var locks = {};


function showDialogTooltip(dialogId, element) {
    var e = $(element);
    if (!locks[e.id]) {
        locks[e.id] = true;
    }
    e.innerHTML = "Dialog: " + dialogId;
    locks[e.id] = false;
}

YAHOO.util.Event.onDOMReady(IMAGINARIUM.initBatch.run);
